package com.test.daily.leetcode.y2021.m11.day1101;

import java.util.HashSet;

/**
 * @descriptions:
 * @author: Tom
 * @date: 2021/11/1 上午 09:42
 * @version: 1.0
 */
public class Code01_DistributeCandies {

    public int distributeCandies(int[] candyType) {
        HashSet<Integer> candyTypeSet = new HashSet<>();
        for(int i = 0; i < candyType.length; i++){
            candyTypeSet.add(candyType[i]);
        }
        return Math.min(candyType.length/2, candyTypeSet.size());
    }
}
